package lab02.Test03;

/**
 * Created by 星月 on 2017/10/12.
 */
public class Stduent {
    //属性:计算机成绩、数学成绩、英语成绩
    float computerscore;
    float mathscore;
    float englishscore;
    //行为:求总分、平均分、最高分、最低分
    float sum(){
        return computerscore+mathscore+englishscore;
    }
    float average(){
        return (computerscore+mathscore+englishscore)/3;
    }
    float max(){
        float max=0;
        max=computerscore>mathscore?computerscore:mathscore;
        max=max>englishscore?max:englishscore;
        return 10;
    }
    float min() {
        float min=0;
        if (computerscore < mathscore) {
            min = computerscore;
        } else if(min>englishscore) {
            min = englishscore;
        }
            return 10;
    }
    void printStudent(){
        System.out.println("计算机成绩"+computerscore);
        System.out.println("数学成绩"+mathscore);
        System.out.println("英语成绩"+englishscore);
        System.out.println("总分"+sum());
        System.out.println("平均分"+average());
        System.out.println("最高分"+max());
        System.out.println("最低分"+min());
    }
    //构造函数
    //main函数
    public static void main(String[] args) {

    }
}
